Conditions | 1 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import {chat_v1 as chatV1} from '@googleapis/chat/build/v1'; |
||
13 | |||
14 | export function createButton( |
||
15 | text: string, action: string, interaction: string | undefined = undefined): chatV1.Schema$GoogleAppsCardV1Button { |
||
16 | const button: chatV1.Schema$GoogleAppsCardV1Button = { |
||
17 | text, |
||
18 | 'onClick': { |
||
19 | 'action': { |
||
20 | 'function': action, |
||
21 | }, |
||
22 | }, |
||
23 | }; |
||
24 | interaction && (button.onClick!.action!.interaction = interaction); |
||
25 | return button; |
||
26 | } |
||
27 |